Skip to content

feat(frontend): surface signups-closed reason from loadUserProfile#12621

Merged
AntonioVentilii merged 5 commits intomainfrom
feat/frontend-load-user-profile-signups-closed
Apr 28, 2026
Merged

feat(frontend): surface signups-closed reason from loadUserProfile#12621
AntonioVentilii merged 5 commits intomainfrom
feat/frontend-load-user-profile-signups-closed

Conversation

@AntonioVentilii
Copy link
Copy Markdown
Collaborator

@AntonioVentilii AntonioVentilii commented Apr 28, 2026

Motivation

Let loadUserProfile distinguish a closed-sign-ups failure from a generic one, so callers can react to it explicitly.

Changes

  • loadUserProfile returns { success: false, err: 'signups-closed' | 'unknown' }.
  • On SignupsClosedError, skips the generic error toast.

Tests

Added tests.

`loadUserProfile` now widens its `ResultSuccess` shape with a typed
failure reason (`signups-closed` | `unknown`). When `createUserProfile`
rejects with `SignupsClosedError`, the service skips the generic error
toast and returns `{ success: false, err: 'signups-closed' }` so callers
can react explicitly (e.g. an info toast + sign-out).
Comment thread src/frontend/src/lib/services/load-user-profile.services.ts Outdated
@AntonioVentilii AntonioVentilii marked this pull request as ready for review April 28, 2026 07:33
@AntonioVentilii AntonioVentilii requested a review from a team as a code owner April 28, 2026 07:33
Copilot AI review requested due to automatic review settings April 28, 2026 07:33
@AntonioVentilii AntonioVentilii changed the title feat(frontend): surface signups-closed reason from loadUserProfile feat(frontend): surface signups-closed reason from loadUserProfile Apr 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the frontend loadUserProfile service to distinguish “signups closed” failures from generic failures, enabling callers to respond explicitly without showing a generic error toast.

Changes:

  • Extend loadUserProfile return type to include a typed failure reason ('signups-closed' | 'unknown').
  • Skip the generic loading-profile toast when the failure is due to SignupsClosedError.
  • Update/add unit tests to validate the new failure shape.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/frontend/src/lib/services/load-user-profile.services.ts Adds typed failure reasons and special-cases SignupsClosedError to return a specific failure reason without a generic toast.
src/frontend/src/tests/lib/services/load-user-profile.spec.ts Updates existing expectations for the new { success: false, err: ... } shape and adds a new signups-closed-focused test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/frontend/src/tests/lib/services/load-user-profile.spec.ts
Comment thread src/frontend/src/lib/services/load-user-profile.services.ts
@AntonioVentilii AntonioVentilii added this pull request to the merge queue Apr 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 28, 2026
@AntonioVentilii AntonioVentilii added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit c498274 Apr 28, 2026
80 checks passed
@AntonioVentilii AntonioVentilii deleted the feat/frontend-load-user-profile-signups-closed branch April 28, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants